home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / pc / SNNSV32.ZIP / SNNSv3.2 / xgui / sources / ui_file.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-04-25  |  18.6 KB  |  619 lines

  1. /*****************************************************************************
  2.   FILE           : ui_file.c
  3.   SHORTNAME      : file.c
  4.   SNNS VERSION   : 3.2
  5.  
  6.   PURPOSE        : popups a window with all filenames. The user may alter 
  7.            the names and may request a save or load operation with 
  8.            the correspondent kind of file (NET, GUI, PAT, CFG, TXT).
  9.   NOTES          : is called only during initialisation
  10.  
  11.   AUTHOR         : Ralf Huebner
  12.   DATE           : 06.04.1992
  13.  
  14.   CHANGED BY     : Michael Vogt, Guenter Mamier
  15.   IDENTIFICATION : @(#)ui_file.c    1.15 4/18/94
  16.   SCCS VERSION   : 1.15 
  17.   LAST CHANGE    : 4/18/94  
  18.  
  19.              Copyright (c) 1990-1994  SNNS Group, IPVR, Univ. Stuttgart, FRG
  20.              
  21. ******************************************************************************/
  22.  
  23.  
  24. #include <stdio.h>
  25. #include <string.h>
  26. #include <sys/types.h>
  27. #include <sys/stat.h>
  28. #include <dirent.h>
  29. #include <malloc.h>
  30.  
  31. #include "ui.h"
  32.  
  33. #ifdef ultrix
  34. #include <sys/file.h>
  35. #else
  36. #include <unistd.h>
  37. #endif
  38.  
  39. #include <X11/Shell.h>
  40. #include <X11/Xaw/Form.h>
  41. #include <X11/Xaw/Command.h>
  42. #include <X11/Xaw/Box.h>
  43. #include <X11/Xaw/AsciiText.h>
  44. #include <X11/Xaw/Label.h>
  45. #include <X11/Xaw/Cardinals.h>
  46.  
  47. #include "ui_fileP.h"
  48. #include "ui_xWidgets.h"
  49. #include "ui_confirmer.h"
  50. #include "ui_main.h"
  51. #include "ui_mainP.h"
  52.  
  53. #include "ui_file.ph"
  54.  
  55.  
  56. /*****************************************************************************
  57.   FUNCTION : ui_loadSelectedFile
  58.  
  59.   PURPOSE  : loads the current file
  60.   RETURNS  : void
  61.   NOTES    : 
  62.  
  63.   UPDATE   :
  64. *****************************************************************************/
  65.  
  66. static void ui_loadSelectedFile (Widget w, Widget button, caddr_t call_data)
  67.  
  68. {
  69.     char selectedName[SELECTED_NAME_LENGTH];
  70.  
  71.     ui_xStringFromAsciiWidget(fileBox, selectedName, SELECTED_NAME_LENGTH);
  72.     ui_xStringFromAsciiWidget(ui_path, ui_pathname, MAX_NAME_LENGTH);
  73.     switch (currentFileType) {
  74.         case UI_FILE_NET: strcpy (ui_filenameNET, selectedName);
  75.                           ui_file_loadNet(w, (XtPointer) button, call_data);
  76.                           break;
  77.     case UI_FILE_PAT: strcpy (ui_filenamePAT, selectedName);
  78.                           ui_file_loadPatterns(w, (XtPointer) button, call_data);
  79.                           break;
  80.     case UI_FILE_RES: strcpy (ui_filenameRES, selectedName);
  81.                           ui_file_loadResult(w, (XtPointer) button, call_data);
  82.                           break;
  83.     case UI_FILE_CFG: strcpy (ui_filenameCFG, selectedName);
  84.                           ui_file_loadConfiguration(w, (XtPointer) button, call_data);
  85.                           break;
  86.     case UI_FILE_TXT: strcpy (ui_filenameTXT, selectedName);
  87.                           ui_file_loadText(w, (XtPointer) button, call_data);
  88.                           break;
  89.     }
  90. }
  91.  
  92.  
  93. /*****************************************************************************
  94.   FUNCTION : ui_saveSelectedFile
  95.  
  96.   PURPOSE  : saves the current file
  97.   RETURNS  : void
  98.   NOTES    : 
  99.  
  100.   UPDATE   :
  101. *****************************************************************************/
  102.  
  103. static void ui_saveSelectedFile (Widget w, Widget button, caddr_t call_data)
  104.  
  105. {
  106.     char selectedName[SELECTED_NAME_LENGTH];
  107.  
  108.     ui_xStringFromAsciiWidget(fileBox, selectedName, SELECTED_NAME_LENGTH);
  109.     ui_xStringFromAsciiWidget(ui_path, ui_pathname, MAX_NAME_LENGTH);
  110.     switch (currentFileType) {
  111.         case UI_FILE_NET: strcpy (ui_filenameNET, selectedName);
  112.                           ui_file_saveNet(w, (XtPointer) button, call_data);
  113.                           break;
  114.     case UI_FILE_PAT: strcpy (ui_filenamePAT, selectedName);
  115.                           ui_file_savePatterns(w, (XtPointer) button, call_data);
  116.                           break;
  117.     case UI_FILE_RES: strcpy (ui_filenameRES, selectedName);
  118.                           ui_file_saveResult(w, (XtPointer) button, call_data);
  119.                           break;
  120.     case UI_FILE_CFG: strcpy (ui_filenameCFG, selectedName);
  121.                           ui_file_saveConfiguration(w, (XtPointer) button, call_data);
  122.                           break;
  123.     case UI_FILE_TXT: strcpy (ui_filenameTXT, selectedName);
  124.                           ui_file_saveText(w, (XtPointer) button, call_data);
  125.                           break;
  126.     }
  127. }
  128.  
  129.  
  130. /*****************************************************************************
  131.   FUNCTION : ui_expandPath
  132.  
  133.   PURPOSE  : expands to full pathname if path = dir/../file
  134.   RETURNS  : void
  135.   NOTES    : 
  136.  
  137.   UPDATE   :
  138. *****************************************************************************/
  139.  
  140. static void ui_expandPath (char *path)
  141.  
  142. {
  143.     char cwd[SELECTED_NAME_LENGTH];
  144.  
  145.     if (*path != '/') {
  146.         getcwd(cwd, SELECTED_NAME_LENGTH);
  147.         strcat(cwd, "/");
  148.         strcat(cwd, path);
  149.         strcpy(path, cwd);   
  150.     }     
  151. }
  152.  
  153.  
  154. /*****************************************************************************
  155.   FUNCTION : ui_checkPath
  156.  
  157.   PURPOSE  : checks the existance of a directory
  158.   RETURNS  : current directory if failed
  159.   NOTES    : 
  160.  
  161.   UPDATE   :
  162. *****************************************************************************/
  163.  
  164. static void ui_checkPath (char *path)
  165.  
  166. {
  167.     char cwd[SELECTED_NAME_LENGTH];
  168.     char errorMsg[2048];
  169.     DIR *dirp;
  170.  
  171.     dirp = opendir (path); 
  172.     if (dirp == NULL) {
  173.         getcwd(cwd, SELECTED_NAME_LENGTH);
  174.         sprintf (errorMsg, "Error! Can't read path:\n%s\nchanging to\n%s\n", 
  175.                    ui_pathname, cwd);
  176.     ui_confirmOk(errorMsg);
  177.         strcpy(path, cwd);
  178.         ui_xSetString(ui_path, path);
  179.     } else     
  180.         closedir (dirp);
  181. }
  182.  
  183.  
  184. /*****************************************************************************
  185.   FUNCTION : ui_strSort
  186.  
  187.   PURPOSE  : sorts the current directory
  188.   RETURNS  : void
  189.   NOTES    : modified quicksort algorithm for strings
  190.  
  191.   UPDATE   :
  192. *****************************************************************************/
  193.  
  194. static void ui_strSort (int left, int right)
  195.  
  196. {
  197.  
  198.     int i, j;
  199.     char *px, *pw;
  200.  
  201.     do {
  202.         px = dirPtr[(left+right) / 2];
  203.         i = left;
  204.         j = right;
  205.         do {
  206.             while (strcmp(dirPtr[i], px) < 0)
  207.                 i++;
  208.             while (strcmp(dirPtr[j], px) > 0)
  209.                 j--;
  210.             if (i > j)
  211.                 break;
  212.             pw = dirPtr[i];
  213.             dirPtr[i] = dirPtr[j];
  214.             dirPtr[j] = pw;
  215.     } 
  216.         while (++i <= --j);
  217.         if (j - left < right - i) {
  218.             if (left < j)
  219.                 ui_strSort (left, j);
  220.             left = i;
  221.             j = right;
  222.         } else {
  223.             if (i < right)
  224.                 ui_strSort (i, right);
  225.             right = j;
  226.             i = left;
  227.         }
  228.     }
  229.     while (left < right);   
  230.  
  231. }
  232.  
  233.  
  234. /*****************************************************************************
  235.   FUNCTION : ui_readDirectory
  236.  
  237.   PURPOSE  : reads the contents of the current directory
  238.   RETURNS  : void
  239.   NOTES    : puts 0x01 and 0x02 around the name if entry is a subdirectory
  240.  
  241.   UPDATE   :
  242. *****************************************************************************/
  243.  
  244. static void ui_readDirectory (void)
  245.  
  246. {
  247.     struct dirent *dp;   
  248.     DIR *dirp;
  249.     int i;
  250.     char *sptr, *pptr;
  251.     char newpath[MAX_NAME_LENGTH];
  252.     char tempName[MAX_NAME_LENGTH];
  253.     
  254.     dirEntries[0] = '\0';
  255.     dirp = opendir (ui_pathname); 
  256.     stat_buf = (struct stat *) malloc (sizeof (struct stat)); 
  257.     while((dp = readdir(dirp)) != NULL){
  258.         strcpy (newpath, ui_pathname);
  259.         strcat (newpath, "/");
  260.         strcat (newpath, dp->d_name);
  261.         stat (newpath, stat_buf);
  262.         if (S_ISDIR(stat_buf->st_mode)   AND
  263.            (access(newpath,R_OK | X_OK)==0)) {
  264.             strcat (dirEntries, "\1");
  265.             strcat (dirEntries, dp->d_name);
  266.             strcat (dirEntries, "\2");
  267.         strcat (dirEntries, "\n");
  268.         } else {
  269.         sptr = strrchr (dp->d_name, '.'); 
  270.             if (sptr != NULL) {
  271.                 if (strcmp(sptr, extMask) == 0) {
  272.                    strcpy (tempName, dp->d_name);
  273.                 pptr = strrchr (tempName, '.');
  274.                 *pptr = '\0';
  275.                     strcat (dirEntries, tempName);
  276.                     strcat (dirEntries, "\n");
  277.         }
  278.         }
  279.     }
  280.     }    
  281.     closedir (dirp);
  282.     free (stat_buf);
  283.     maxEntries = 1;
  284.     dirPtr[0] = dirEntries;
  285.     for (sptr = dirEntries; *sptr != '\0'; sptr++) {
  286.         if (*sptr == '\n') {
  287.             *sptr = '\0';
  288.             dirPtr[maxEntries] = sptr + 1;
  289.             maxEntries++;
  290.             if (maxEntries == MAX_DIR_ENTRIES) {
  291.             ui_confirmOk("Error! Directory too large");
  292.                 return;
  293.         }
  294.     }
  295.     }
  296.  
  297.     ui_strSort (0, maxEntries-2);
  298.  
  299.     sortedDirEntries[0] = '\0';
  300.     for (i=0; i<maxEntries; i++) {
  301.         strcat (sortedDirEntries, dirPtr[i]);
  302.         strcat (sortedDirEntries, "\n");
  303.     }
  304.  
  305.     for (sptr = sortedDirEntries; *sptr != '\0'; sptr++) {
  306.         switch (*sptr) {
  307.         case '\1': *sptr = '[';
  308.                        break;
  309.         case '\2': *sptr = ']';
  310.                        break;
  311.         }
  312.     }
  313. }
  314.  
  315.  
  316. /*****************************************************************************
  317.   FUNCTION : ui_setExtString
  318.  
  319.   PURPOSE  : sets the file extention to .txt, .pat, cfg or .txt
  320.   RETURNS  : void
  321.   NOTES    : 
  322.  
  323.   UPDATE   :
  324. *****************************************************************************/
  325.  
  326. static void ui_setExtString (Widget w, int fileType, caddr_t call_data)
  327.  
  328. {
  329.     Arg        args[2];
  330.     Cardinal    n;
  331.  
  332.     ui_xSetToggleState (netToggle, FALSE);    
  333.     ui_xSetToggleState (patToggle, FALSE);    
  334.     ui_xSetToggleState (resToggle, FALSE);    
  335.     ui_xSetToggleState (cfgToggle, FALSE);    
  336.     ui_xSetToggleState (txtToggle, FALSE);    
  337.     switch (fileType) {
  338.         case UI_FILE_NET: ui_xSetToggleState (netToggle, TRUE);
  339.                           ui_xSetString(fileBox, ui_filenameNET);
  340.                           strcpy (extMask, ".net");
  341.                           break;
  342.         case UI_FILE_PAT: ui_xSetToggleState (patToggle, TRUE);
  343.                           ui_xSetString(fileBox, ui_filenamePAT);
  344.                           strcpy (extMask, ".pat");
  345.                           break;
  346.         case UI_FILE_RES: ui_xSetToggleState (resToggle, TRUE);
  347.                           ui_xSetString(fileBox, ui_filenameRES);
  348.                           strcpy (extMask, ".res");
  349.                           break;
  350.         case UI_FILE_CFG: ui_xSetToggleState (cfgToggle, TRUE);
  351.                           ui_xSetString(fileBox, ui_filenameCFG);
  352.                           strcpy (extMask, ".cfg");
  353.                           break;
  354.         case UI_FILE_TXT: ui_xSetToggleState (txtToggle, TRUE);
  355.                           ui_xSetString(fileBox, ui_filenameTXT);
  356.                           strcpy (extMask, ".txt");
  357.                           break;
  358.     }
  359.     currentFileType = fileType;
  360.     ui_xStringFromAsciiWidget(ui_path, ui_pathname, MAX_NAME_LENGTH);
  361.     ui_checkPath(ui_pathname);
  362.     ui_readDirectory ();
  363.     n = 0;
  364.     XtSetArg(args[n], XtNstring, sortedDirEntries); n++;
  365.     XtSetValues (selectorBox, args, n);
  366. }
  367.  
  368.  
  369. /*****************************************************************************
  370.   FUNCTION : ui_changeDirectory
  371.  
  372.   PURPOSE  : changes the current path for the input
  373.   RETURNS  : void
  374.   NOTES    : doesn't work with an auto mounter
  375.  
  376.   UPDATE   :
  377. *****************************************************************************/
  378.  
  379. static void ui_changeDirectory (char dirName[])
  380.     /* K&R-Style:  char dirName[MAX_NAME_LENGTH]; */
  381.      
  382. {
  383.     char *sptr;
  384.     Arg        args[2];
  385.     Cardinal    n;
  386.  
  387.     if ((dirName[0] == '.') AND (dirName[1] == '\0'))
  388.         return;
  389.     if ((dirName[0] == '.') AND (dirName[1] == '.')) {
  390.       if (strcmp (ui_pathname, "/") == 0)
  391.         return;
  392.       sptr = strrchr(ui_pathname, '/');
  393.        if (sptr == ui_pathname)
  394.          sptr++;
  395.        *sptr = '\0';
  396.     } else {
  397.        if (strcmp (ui_pathname, "/") != 0)
  398.            strcat(ui_pathname, "/");
  399.        strcat(ui_pathname, dirName);
  400.     }
  401.     ui_checkPath(ui_pathname);
  402.     ui_readDirectory();
  403.     ui_xSetString(ui_path, ui_pathname);
  404.     n = 0;
  405.     XtSetArg(args[n], XtNstring, sortedDirEntries); n++;
  406.     XtSetValues (selectorBox, args, n);
  407. }
  408.  
  409.  
  410. /*****************************************************************************
  411.   FUNCTION : ui_selectionEventProc
  412.  
  413.   PURPOSE  : puts the current filename in the dialog wisgwt after the second
  414.              mouseklick
  415.   RETURNS  : void
  416.   NOTES    : 
  417.  
  418.   UPDATE   :
  419. *****************************************************************************/
  420.  
  421. static void ui_selectionEventProc (Widget w, Display *display, XEvent *event)
  422.  
  423. {
  424.     Widget           src;
  425.     XawTextBlock     textBlock;
  426.     XawTextPosition  start, end, found;
  427.     Cardinal         n;
  428.     Arg              args[5];
  429.     char             selectedName[SELECTED_NAME_LENGTH];
  430.     char             realName[SELECTED_NAME_LENGTH];
  431.     Boolean          nlStarts, nlEnds;
  432.     int              i;
  433.  
  434.     selectedName[0] = '\0';
  435.     switch (event->type) {
  436.         case ButtonRelease:
  437.             if (event->xbutton.button == 1) {
  438.                  XawTextGetSelectionPos(selectorBox, &start, &end);
  439.                  if (start != end) {
  440.                      n = 0;
  441.                  XtSetArg(args[n], XtNtextSource, &src); n++;
  442.                  XtGetValues (selectorBox, args, n);
  443.                  found = XawTextSourceRead(src, (int) start, &textBlock, 
  444.                          (int) (end-start));
  445.                  if (found > 0) {
  446.                          nlStarts = nlEnds = FALSE;
  447.                      strncpy(selectedName, textBlock.ptr-1, 
  448.                 (unsigned int) (end-start+2));
  449.                          selectedName[end-start+2] = '\0';
  450.                      if (selectedName[0] == '\n')
  451.                              nlStarts = TRUE;
  452.                      if (selectedName[strlen(selectedName)-1] == '\n')
  453.                              nlEnds = TRUE;
  454.                          if (nlStarts AND nlEnds) {
  455.                              for (i=0; i<end-start; i++)
  456.                                  realName[i] = selectedName[i+1];
  457.                              realName[end-start] = '\0';
  458.                              if (strchr(realName, '\n') != NULL)
  459.                                  return;
  460.                              if (realName[0] != '[') {
  461.                                  n = 0;
  462.                                  XtSetArg (args[n], XtNstring, realName); n++;
  463.                                  XtSetValues (fileBox, args, n);
  464.                  } else {
  465.                      for (i=0; i<strlen(realName)-2; i++)
  466.                                       realName[i] = realName[i+1];
  467.                  realName[strlen(realName)-2] = '\0';
  468.                  ui_changeDirectory(realName);
  469.                  }
  470.                  }
  471.              }
  472.          }
  473.       }
  474.     }
  475. }
  476.  
  477.  
  478. /*****************************************************************************
  479.   FUNCTION : ui_xCreateFilePanel
  480.  
  481.   PURPOSE  : create the file selector panel
  482.   RETURNS  : void
  483.   NOTES    : the wigdet will be created in relative position to eachother
  484.  
  485.   UPDATE   :
  486. *****************************************************************************/
  487.  
  488. void ui_xCreateFilePanel (Widget parent)
  489.            /* the parent widget of the new form widget */
  490.  
  491. {
  492.     int  fontWidth = 8;
  493.     int  titelWidth  = 14 * fontWidth;
  494.     int  nameWidth   = 15 * fontWidth;  
  495.  
  496.     Arg        args[20];
  497.     Cardinal    n;
  498.     Widget      dummy, button, label;
  499.  
  500.     ui_filePanel =
  501.     XtCreateManagedWidget("fPanel", formWidgetClass, parent, NULL, ZERO);
  502.     ui_expandPath(ui_pathname);
  503.     ui_path =
  504.     ui_xCreateDialogItem("path", ui_filePanel, ui_pathname, 0 /* free */, NULL, NULL);
  505.  
  506.     strcpy (extMask, ".net");
  507.     currentFileType = UI_FILE_NET;
  508.  
  509.     ui_checkPath(ui_pathname);
  510.     ui_readDirectory ();
  511.  
  512.     n = 0;
  513.     XtSetArg(args[n], XtNwidth,  150); n++;
  514.     XtSetArg(args[n], XtNheight, 245); n++;
  515.     XtSetArg(args[n], XtNtype, XawAsciiString); n++;
  516.     XtSetArg(args[n], XtNstring, sortedDirEntries); n++;
  517.     XtSetArg(args[n], XtNscrollVertical, XawtextScrollAlways); n++;
  518.     XtSetArg(args[n], XtNdisplayCaret, FALSE); n++;
  519.     XtSetArg(args[n], XtNfromVert , ui_path);  n++;
  520.     XtSetArg(args[n], XtNfromHoriz, NULL);  n++;
  521.     XtSetArg(args[n], XtNleft  , XtChainLeft);   n++;
  522.     XtSetArg(args[n], XtNright , XtChainLeft);   n++;
  523.     XtSetArg(args[n], XtNtop   , XtChainTop);    n++;
  524.     XtSetArg(args[n], XtNbottom, XtChainTop);    n++;    
  525.     selectorBox = XtCreateManagedWidget("textWin", asciiTextWidgetClass, 
  526.        ui_filePanel, args, n);
  527.  
  528.     XtAddEventHandler (selectorBox, ButtonReleaseMask, 
  529.                         FALSE, (XtEventHandler) ui_selectionEventProc, 
  530.             ui_display);
  531.  
  532.     fileBox =
  533.     ui_xCreateDialogItem("filebox", ui_filePanel, "", nameWidth,
  534.                        selectorBox, ui_path);
  535.  
  536.     ui_xSetResize(fileBox, TRUE);
  537.     ui_xSetString(fileBox, ui_filenameNET);
  538.  
  539.     dummy =
  540.     ui_xCreateLabelItem(" ", ui_filePanel, 8, selectorBox, fileBox);
  541.  
  542.     dummy =
  543.     ui_xCreateLabelItem(" ", ui_filePanel, 8, selectorBox, dummy);
  544.  
  545.     netToggle =
  546.     ui_xCreateToggleItem("net", ui_filePanel, NULL,
  547.         selectorBox, dummy);
  548.     label =
  549.     ui_xCreateLabelItem(" Network", ui_filePanel, titelWidth,
  550.         netToggle, dummy);
  551.     patToggle =
  552.     ui_xCreateToggleItem("pat", ui_filePanel, NULL, 
  553.         selectorBox , netToggle);
  554.     label =
  555.     ui_xCreateLabelItem(" Patterns", ui_filePanel, titelWidth,  
  556.         patToggle, netToggle);
  557.     resToggle =
  558.     ui_xCreateToggleItem("res", ui_filePanel, NULL, 
  559.         selectorBox , patToggle);
  560.     label =
  561.     ui_xCreateLabelItem(" Result File", ui_filePanel, titelWidth,  
  562.         resToggle, patToggle);
  563.     cfgToggle =
  564.     ui_xCreateToggleItem("cfg", ui_filePanel, NULL,
  565.         selectorBox , resToggle);
  566.     label =
  567.     ui_xCreateLabelItem(" Config", ui_filePanel, titelWidth,  
  568.         cfgToggle, resToggle);
  569.     txtToggle =
  570.     ui_xCreateToggleItem("txt", ui_filePanel, NULL, 
  571.         selectorBox , cfgToggle);
  572.     label =
  573.     ui_xCreateLabelItem(" Log File", ui_filePanel, titelWidth,  
  574.         txtToggle, cfgToggle);
  575.  
  576.     XtAddCallback(netToggle, XtNcallback, (XtCallbackProc) ui_setExtString, 
  577.         (caddr_t) UI_FILE_NET);
  578.     XtAddCallback(patToggle, XtNcallback, (XtCallbackProc) ui_setExtString, 
  579.         (caddr_t) UI_FILE_PAT);
  580.     XtAddCallback(resToggle, XtNcallback, (XtCallbackProc) ui_setExtString, 
  581.         (caddr_t) UI_FILE_RES);
  582.     XtAddCallback(cfgToggle, XtNcallback, (XtCallbackProc) ui_setExtString, 
  583.         (caddr_t) UI_FILE_CFG);
  584.     XtAddCallback(txtToggle, XtNcallback, (XtCallbackProc) ui_setExtString, 
  585.         (caddr_t) UI_FILE_TXT);
  586.  
  587.     dummy =
  588.     ui_xCreateLabelItem(" ", ui_filePanel, 8, selectorBox, txtToggle);
  589.  
  590.     dummy =
  591.     ui_xCreateLabelItem(" ", ui_filePanel, 8, selectorBox, dummy);
  592.  
  593.     dummy =
  594.     ui_xCreateLabelItem(" ", ui_filePanel, 8, selectorBox, dummy);
  595.  
  596.     button =
  597.     ui_xCreateButtonItem("load", ui_filePanel, selectorBox , dummy);
  598.  
  599.     XtAddCallback(button, XtNcallback,
  600.         (XtCallbackProc) ui_loadSelectedFile, NULL);
  601.  
  602.     button =
  603.     ui_xCreateButtonItem("save", ui_filePanel, button , dummy);
  604.  
  605.     XtAddCallback(button, XtNcallback,
  606.         (XtCallbackProc) ui_saveSelectedFile, NULL);
  607.  
  608.     XawFormDoLayout(ui_filePanel, True);
  609.  
  610.     ui_xSetToggleState (netToggle, TRUE);    
  611.  
  612. }
  613.  
  614.  
  615.  
  616.  
  617. /* end of file */
  618. /* lines: 521 */
  619.